Plot sites on the diagonal from Birmingham to London

sites_index_diagonal <- c(161,144,128,110,92,77,78) # first is Birmingham and last is London
site_name_diagonal <- c("Birmingham", paste0("diagonal",1:5),"London")
# plot these points on a map
uk_sf_rot <- uk_sf_rot %>% mutate(sites_index_diagonal=factor(case_match(ind,c(161) ~ "Birmingham",c(78)~"London",sites_index_diagonal[2:6]~"diagonal_sites")))
tm_shape(uk_sf_rot) + tm_dots("sites_index_diagonal",size=0.1, palette = c("Birmingham"="#C11432","London" = "#009ADA", "diagonal_sites" = "#FDD10A"))

Estimate all parameters for the sites in colour (including Birmingham and London for testing).

Plot summary of parameters for the sites on the diagonal.

est_all_diag1 <- est_all_diag %>% mutate(cond_site = factor(cond_site,levels=sites_index_diagonal), tau = factor(tau,levels=as.character(dayshift)))
est_all_diag1 %>% ggplot() + geom_boxplot(aes(x=cond_site, y=a))

est_all_diag1 %>% ggplot() + geom_boxplot(aes(x=cond_site, y=b))

There is a decrease in both \(\hat{\boldsymbol{\alpha}}\) and \(\hat{\boldsymbol{\beta}}\).

est_all_diag1 %>% group_by(cond_site) %>% summarise(mean_a=mean(a,na.rm = TRUE),mean_b = mean(b, na.rm = TRUE),median_a=median(a,na.rm = TRUE),median_b = median(b, na.rm = TRUE))
## # A tibble: 7 × 5
##   cond_site mean_a mean_b median_a median_b
##   <fct>      <dbl>  <dbl>    <dbl>    <dbl>
## 1 161        0.449  0.238    0.407    0.255
## 2 144        0.411  0.257    0.363    0.268
## 3 128        0.349  0.189    0.303    0.185
## 4 110        0.391  0.192    0.354    0.196
## 5 92         0.370  0.185    0.338    0.192
## 6 77         0.345  0.146    0.319    0.124
## 7 78         0.349  0.151    0.327    0.141

This decrease is non-linear and can be observed in both mean and median values of \(\hat{\boldsymbol{\alpha}}\) and \(\hat{\boldsymbol{\beta}}\).

Map parameter estimates

condmodel_params <- c("a","b","mu","sig","muagg","sigl","sigu","sigdiff","deltal","deltau","deltadiff")
# for (i in 1:length(sites_index_diagonal)) {
# tau_site_map <- map_param(tmp_est=est_all_diag1 %>% filter(cond_site== sites_index_diagonal[i]), method = "AGG", facet_var = "tau", title_map = site_name_diagonal[i],grid_uk = uk_temp_sf)
#   for (j in 1:length(condmodel_params)) {
#     tmap_save(tau_site_map[[j]],filename=paste0("../Documents/est_all_diag/tau_",site_name_diagonal[i],"_map_",j,"_",condmodel_params[j],".png"),width=15,height=4.5)
#   }
# }

# map also a grid of alpha and beta estimates
est_all_diag1 <- est_all_diag1 %>% mutate(cond_site = factor(as.character(cond_site),levels=as.character(sites_index_diagonal)))
tau_map <- map_param(tmp_est=est_all_diag1, method = "AGG", facet_var = c("cond_site","tau"), title_map = "Diagonal sites",grid_uk = uk_temp_sf)
tau_map[[1]]

tau_map[[2]]

  # for (j in 1:length(condmodel_params)) {
  #   tmap_save(tau_map[[j]],filename=paste0("../Documents/est_all_diag/allsites_tau_map_",j,"_",condmodel_params[j],".png"),width=6,height=10)
  # }

Plot also return levels for conditional quantiles as before.

tmp025_q

tmp075_q

And also plot return levels.

tmp025_rl

tmp075_rl

And return level difference.

tmap_diff

And relative return level difference.

tmap_reldiff